{% extends 'base.html' %}

{% block content %}
<div class="container mt-4">
    <h2>表彰记录列表</h2>
    <a href="{% url 'core:honor_record_create' %}" class="btn btn-primary mb-3 me-2"><i class="bi bi-plus-circle me-2"></i>新增表彰记录</a>
    <a href="{% url 'core:honor_type_list' %}" class="btn btn-secondary mb-3"><i class="bi bi-arrow-left me-2"></i>返回荣誉类型列表</a>
    <table class="table table-striped table-hover">
        <thead class="table-dark">
            <tr>
                <th scope="col">名称</th>
                <th scope="col">类型</th>
                <th scope="col">日期</th>
                <th scope="col">操作</th>
            </tr>
        </thead>
        <tbody>
            {% for record in object_list %}
            <tr>
                <td>{{ record.title }}</td>
                <td>{{ record.honor_type }}</td>
                <td>{{ record.award_date|date:"Y-m-d" }}</td>
                <td>
                    <a href="{% url 'core:honor_record_update' record.pk %}" class="btn btn-sm btn-warning me-2"><i class="bi bi-pencil me-1"></i>编辑</a>
                    <a href="{% url 'core:honor_record_delete' record.pk %}" class="btn btn-sm btn-danger"><i class="bi bi-trash me-1"></i>删除</a>
                </td>
            </tr>
            {% empty %}
            <tr>
                <td colspan="4" class="text-center text-muted">暂无表彰记录。</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}